# Maintainer: Antoni Aloy <aaloytorrens@gmail.com>
pkgname=featherpad
pkgver=1.1.0
pkgrel=0
pkgdesc="Lightweight Qt plain-text editor"
url="https://github.com/tsujan/FeatherPad"
license="GPL-3.0-or-later"
arch="all"
makedepends="
	cmake libx11-dev qt5-qtbase-dev qt5-qtsvg-dev
	qt5-qttools-dev qt5-qtx11extras-dev hunspell-dev
	"
subpackages="$pkgname-lang"
options="!check" # no test suite
source="https://github.com/tsujan/FeatherPad/releases/download/V$pkgver/FeatherPad-$pkgver.tar.xz"
builddir="$srcdir/FeatherPad-$pkgver"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DBUILD_SHARED_LIBS=True \
		$CMAKE_CROSSOPTS .
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

lang() {
	amove usr/share/featherpad/translations
}

sha512sums="
0a4dcdbdb6edc1a11a6dba5dd3afa04bb435f1d722211c45c7f8ca465b67accced706cb56e0989788b5be7624c6b31cf4782735c91c5e819df2e6a32947ec1f0  FeatherPad-1.1.0.tar.xz
"
